<template>
  <el-carousel :interval="3000"  trigger="click"  :height='imgHeight'>
    <el-carousel-item v-for="(item,index) in imgList" :key="index" >
      <img ref="Oimg" :src="item.url" alt="" @load="setHeight">
    </el-carousel-item>
  </el-carousel>
</template>
<style src=""></style>
<script>
    export default {
      name: "swiper",
      data(){
        return {
          imgHeight:"",
          imgList:[
            {
              url:'./static/img/banner.jpg'
            },
            {
              url:'./static/img/banner.jpg'
            },
            {
              url:'./static/img/banner.jpg'
            }
          ]
        }
      },
      mounted() {
      },
      methods:{
        setHeight() {
          this.imgHeight = this.$refs.Oimg[0].height+"px"
        }
      }
    }
</script>

<style scoped>

</style>
